<?php echo $__env->make('admin::layouts.header', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<div class="admin-main layui-anim layui-anim-upbit">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>表名【<?php echo e($table); ?>】<?php echo e($comment); ?></legend>
    </fieldset>
    <table class="layui-table" id="list" lay-filter="list"></table>
</div>
<?php echo $__env->make('admin::layouts.footer', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<script type="text/html" id="topBtn">
	<blockquote class="layui-elem-quote">
        数据表中共有<i class="count"></i>个字段
    </blockquote>
</script>
<script>
    layui.use(['table','form'], function() {
        var table = layui.table,form = layui.form,$ = layui.jquery;
        var tableIn = table.render({
			id: 'database',
            elem: '#list',
            url: "<?php echo e(route('admin.data_base.table_data',['table'=>$table])); ?>",
            method:'get',
			toolbar: '#topBtn',
			title:"表名【<?php echo e($table); ?>】<?php echo e($comment); ?>",
            cols: [[
                {field: 'COLUMN_NAME',align: 'center', title: '字段名', width: 150},
                {field: 'COLUMN_TYPE',align: 'center', title: '数据类型', width: 150},
                {field: 'COLUMN_DEFAULT',align: 'center', title: '默认值', width: 150},
                {field: 'IS_NULLABLE',align: 'center', title: '允许非空', width: 150},
                {field: 'EXTRA',align: 'center', title: '自动递增', width: 150},
                {field: 'COLUMN_COMMENT',align: 'center', title: '备注', width: 400}
            ]],
			parseData: function(res){ //将原始数据解析成 table 组件所规定的数据
				  return res;
			},
			done: function(res, curr, count){
                $('.count').html(res.tableNum);
            }	
        });
    });
</script>
</body>
</html>